/* 69. x 的平方根  */
/**
 * @param {number} x
 * @return {number}
 */
var mySqrt = function (x) {
	if (x <= 1) return x
	let left = 0,
		right = x,
		ans = 0
	while (left < right) {
		const mid = left + ((right - left) >> 1)
		if (mid * mid <= x) {
			ans = mid
			left = mid + 1
		} else {
			right = mid
		}
	}
	return ans
}
const ans = mySqrt(50)
console.log('ans :>>', ans)
